-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] Add logs for kubernetes events #6793
Conversation
7383a6f
to
ffbdb32
Compare
/ok-to-test |
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
ffbdb32
to
c3cf9f6
Compare
/ok-to-test |
Radius functional test overview
Click here to see the list of tools in the current test run
Test Status⌛ Building Radius and pushing container images for functional tests... |
@@ -559,6 +560,30 @@ jobs: | |||
--subscription ${{ secrets.INTEGRATION_TEST_SUBSCRIPTION_ID }} \ | |||
--name ${{ env.AZURE_TEST_RESOURCE_GROUP }} \ | |||
--yes --verbose | |||
# TODO add once tested: if: failure() && steps.publish-tf-recipes.outcome == 'failure' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be bad if we just always included these logs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it wouldn't. We wanted to track recipe upload failures specifically, but we could just track the events whenever they're uploaded
label="app.kubernetes.io/name=tf-module-server" | ||
pod_names=($(kubectl get pods -l $label -n $namespace -o jsonpath='{.items[*].metadata.name}')) | ||
for pod_name in "${pod_names[@]}"; do | ||
kubectl logs $pod_name -n $namespace > recipes/pod-logs/${pod_name}.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a log here like echo "Pod ${pod_name} logs saved to recipes/pod-logs/"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a line below that logs when all of them are uploaded but will update to this
done | ||
echo "Pod logs saved to recipes/pod-logs/" | ||
# Get kubernetes events and save to file | ||
kubectl get events -n $namespace > recipes/pod-logs/events.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe another log after this line to state that the events are saved?
616f0fa
to
d0423f5
Compare
Description
Adding logs to track pod failures during schedule func test runs
Type of change
Fixes: #issue_number
Auto-generated summary
🤖[deprecated] Generated by Copilot at d314bb0
Summary
🐽🛠
Enhance functional-test workflow to capture pod logs and events on failure. Add
id
topublish-tf-recipes
step and two new steps to.github/workflows/functional-test.yaml
.Walkthrough
id
to the recipe publishing step to enable conditional execution of subsequent steps (link)